package com.suxin.exception.assertM;

import java.text.MessageFormat;

/**
 * @author Tang
 * @classname BusinessExceptionAssert
 * @description [  ]
 * @date 2022/10/27 16:38
 */
public interface BusinessExceptionAssert extends Assert, IResponseEnum {

    @Override
    default BaseException newException(Object target, Object... args) {
        String formatMessage = MessageFormat.format(getMessage(), args);
        return new BusinessException(this, args, formatMessage);
    }

    @Override
    default BaseException newException(Throwable throwable, Object target, Object... args) {
        String formatMessage = MessageFormat.format(this.getMessage(), args);
        return new BusinessException(this, args, formatMessage);
    }
}